package alibaba;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        String[] ss = s.split(" ");
        int n = Integer.parseInt(ss[0]);
        long k = Long.parseLong(ss[1]);
        s = buf.readLine();
        ss = s.split(" ");
        long[] arr = new long[n];
        long maxValue = 0;
        long sum = 0;
        for (int i = 0; i < n; i++){
            arr[i] = Long.parseLong(ss[i]);
            if (arr[i] > maxValue){
                maxValue = arr[i];
            }
            sum += arr[i];
        }
        long num = (long) maxValue * n - sum;
        if (num >= k){
            System.out.println(maxValue);
        } else {
            long tmp = k - num;
            long x = tmp/n;
            long y = tmp%n;
            long res = maxValue;
            if (y == 0){
                res += x;
            } else {
                res += (x + 1);
            }
            System.out.println(res);
        }


    }
}
